﻿<%@ Page Title="View Reports" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ViewReports.aspx.cs" Inherits="TestJQGrid.ViewReports" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <!-- jQuery runtime minified -->
    <script src="../js/jquery-1.4.4.min.js" type="text/javascript"></script>
    <!-- The localization file we need, English in this case -->
    <script src="../js/trirand/i18n/grid.locale-en.js" type="text/javascript"></script>
    <!-- The jqGrid client-side javascript -->
    <script src="../js/trirand/jquery.jqGrid.min.js" type="text/javascript"></script>
    <script src="../js/trirand/jquery.jqDatePicker.min.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table border="1px" style="width: 100%;">
        <tr>
            <td rowspan="3" align="left" valign="top" style="width: 20%;">
                <asp:ListBox ID="LBReportList" runat="server" DataSourceID="DSReportList" DataTextField="ReportName"
                    DataValueField="ReportId" OnDataBound="LBReportList_DataBound" OnSelectedIndexChanged="LBReportList_SelectedIndexChanged"
                    Rows="25" Width="100%" AutoPostBack="True"></asp:ListBox>
                <asp:SqlDataSource ID="DSReportList" runat="server" ConnectionString="<%$ ConnectionStrings:AgentBillingConnectionString %>"
                    SelectCommand="SELECT [ReportId], [ReportName] FROM [Reports] WHERE ([ProductName] = @ProductName)">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="CarSales" Name="ProductName" SessionField="ProductName"
                            Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td align="left" valign="top" style="height: 30%;" />
        </tr>
        <tr>
            <td align="left" valign="top" style="height: 60%;">
                <asp:GridView ID="GVReport" runat="server" 
                GridLines="None"  
                AllowPaging="true"  
                CssClass="mGrid"  
                PagerStyle-CssClass="pgr"  
                AlternatingRowStyle-CssClass="alt" 
                    onpageindexchanging="GVReport_PageIndexChanging">
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td align="center" valign="middle" style="height: 10%;">
                <asp:Label ID="Label1" runat="server" Enabled="False" Text="Download As" Width="100px"></asp:Label>
                <asp:DropDownList ID="DDLDownloadType" runat="server">
                    <asp:ListItem Selected="True" Value="0">Excel</asp:ListItem>
                    <asp:ListItem Value="1">CSV (,)</asp:ListItem>
                    <asp:ListItem Value="2">CSV (|)</asp:ListItem>
                    <asp:ListItem Value="3">PDF</asp:ListItem>
                    <asp:ListItem Value="4">MS WORD</asp:ListItem>
                </asp:DropDownList>
                &nbsp;
                <asp:Button ID="BDownload" runat="server" Text="Download" OnClick="BDownload_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
